package com.example.mybatis.fluent.db.entity;

import cn.org.atool.fluent.mybatis.annotation.FluentMybatis;
import cn.org.atool.fluent.mybatis.annotation.GmtCreate;
import cn.org.atool.fluent.mybatis.annotation.GmtModified;
import cn.org.atool.fluent.mybatis.annotation.LogicDelete;
import cn.org.atool.fluent.mybatis.annotation.TableField;
import cn.org.atool.fluent.mybatis.annotation.TableId;
import cn.org.atool.fluent.mybatis.base.RichEntity;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * SysUserEntity: 数据映射实体定义
 *
 * @author Powered By Fluent Mybatis
 */
@SuppressWarnings({"rawtypes", "unchecked"})
@Data
@Accessors(
    chain = true
)
@EqualsAndHashCode(
    callSuper = false
)
@AllArgsConstructor
@NoArgsConstructor
@FluentMybatis(
    table = "sys_user",
    schema = "zhqj"
)
public class SysUserEntity extends RichEntity {
  private static final long serialVersionUID = 1L;

  @TableId(
      value = "user_id",
      desc = "自增ID"
  )
  private Long userId;

  @TableField(
      value = "email",
      desc = "邮箱"
  )
  private String email;

  @TableField(
      value = "is_active",
      desc = "激活状态 false未激活，true已激活，默认false"
  )
  private Boolean isActive;

  @TableField(
      value = "is_disable",
      desc = "禁用状态（注销） false未禁用，true已禁用，默认false"
  )
  private Boolean isDisable;

  @TableField(
      value = "job_num",
      desc = "工号"
  )
  private String jobNum;

  @TableField(
      value = "last_login_ip",
      desc = "上次登陆IP"
  )
  private String lastLoginIp;

  @TableField(
      value = "last_login_time",
      desc = "上次登陆时间"
  )
  private Date lastLoginTime;

  @TableField(
      value = "login_count",
      desc = "登陆次数"
  )
  private Long loginCount;

  @TableField(
      value = "login_failed_count",
      desc = "登陆失败尝试次数"
  )
  private Integer loginFailedCount;

  @TableField(
      value = "nick_name",
      desc = "用户昵称"
  )
  private String nickName;

  @TableField(
      value = "password",
      desc = "密码"
  )
  private String password;

  @TableField(
      value = "sex",
      desc = "性别 1：男，2：女"
  )
  private Integer sex;

  @TableField(
      value = "simplified_pinyin",
      desc = "简拼"
  )
  private String simplifiedPinyin;

  @TableField(
      value = "title",
      desc = "抬头"
  )
  private String title;

  @TableField(
      value = "update_pwd_time",
      desc = "密码更新时间"
  )
  private Date updatePwdTime;

  @TableField(
      value = "user_name",
      desc = "用户名"
  )
  private String userName;

  @TableField(
      value = "create_time",
      insert = "now()",
      desc = "创建时间"
  )
  @GmtCreate
  private Date createTime;

  @TableField(
      value = "update_time",
      insert = "now()",
      update = "now()",
      desc = "更新时间"
  )
  @GmtModified
  private Date updateTime;

  @TableField(
      value = "is_delete",
      insert = "0",
      desc = "删除标识 false未删除，true已删除，默认false"
  )
  @LogicDelete
  private Boolean isDelete;

  @Override
  public final Class entityClass() {
    return SysUserEntity.class;
  }
}
